Added some logic.
